//---------------------------------------------------------------------------
// Copyright (C) 1995-1998, Microsoft Corporation
//                 All Rights Reserved
// Information Contained Herein Is Proprietary and Confidential.
//---------------------------------------------------------------------------

#ifndef _MTRunObjects_H_

#define E_INVALIDAPPOBJ				    0x800A02EE
#define VBAMTPROCFLAGS_None		   0x0000
#define VBAMTPROCFLAGS_Public		    0x0001
#define VBAMTPROCFLAGS_Private		    0x0002
#define VBAMTPROCFLAGS_Sub		    0x0004
#define VBAMTPROCFLAGS_Function		  0x0008
#define VBAMTPROCFLAGS_NoParameters 0x0010

#endif 

/* This header file machine-generated by mktyplib.exe */
/* Interface to type library: MTRunObjects */

#ifndef _MTRunObjects_H_
#define _MTRunObjects_H_

DEFINE_GUID(LIBID_MTRunObjects,0x5A224996L,0x0D3B,0x11D2,0xA1,0x8B,0x00,0xC0,0x4F,0x8E,0xC1,0xB3);
#ifndef BEGIN_INTERFACE
#define BEGIN_INTERFACE
#endif

#ifdef __cplusplus
class VbaMT;
#endif

#ifdef __cplusplus
class VbaMTDll;
#endif

#ifdef __cplusplus
class VbaMTDlls;
#endif

interface IVbaMT;

interface IVbaMTDlls;

interface IVbaMTDll;

typedef long DISPID;

typedef short VARIANT_BOOL;

typedef unsigned short VBAMTPROCFLAGS;

typedef struct {
    BSTR name;
    long invokeKind;
    VBAMTPROCFLAGS vbamtProcFlags;
    DISPID dispId;
} MTPROC;

DEFINE_GUID(IID_IMTInstance,0x5A224997L,0x0D3B,0x11D2,0xA1,0x8B,0x00,0xC0,0x4F,0x8E,0xC1,0xB3);

/* Definition of interface: IMTInstance */
#undef INTERFACE
#define INTERFACE IMTInstance

DECLARE_INTERFACE_(IMTInstance, IDispatch)
{
BEGIN_INTERFACE
#ifndef NO_BASEINTERFACE_FUNCS

    /* IUnknown methods */
    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
    STDMETHOD_(ULONG, Release)(THIS) PURE;

    /* IDispatch methods */
    STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE;

    STDMETHOD(GetTypeInfo)(
      THIS_
      UINT itinfo,
      LCID lcid,
      ITypeInfo FAR* FAR* pptinfo) PURE;

    STDMETHOD(GetIDsOfNames)(
      THIS_
      REFIID riid,
      OLECHAR FAR* FAR* rgszNames,
      UINT cNames,
      LCID lcid,
      DISPID FAR* rgdispid) PURE;

    STDMETHOD(Invoke)(
      THIS_
      DISPID dispidMember,
      REFIID riid,
      LCID lcid,
      WORD wFlags,
      DISPPARAMS FAR* pdispparams,
      VARIANT FAR* pvarResult,
      EXCEPINFO FAR* pexcepinfo,
      UINT FAR* puArgErr) PURE;
#endif

    /* IMTInstance methods */
    STDMETHOD(GetAppObjGuid)(THIS_ BSTR FAR* Guid) PURE;
};

DEFINE_GUID(IID_IMTEvents,0x5A224998L,0x0D3B,0x11D2,0xA1,0x8B,0x00,0xC0,0x4F,0x8E,0xC1,0xB3);

/* Definition of interface: IMTEvents */
#undef INTERFACE
#define INTERFACE IMTEvents

DECLARE_INTERFACE_(IMTEvents, IDispatch)
{
BEGIN_INTERFACE
#ifndef NO_BASEINTERFACE_FUNCS

    /* IUnknown methods */
    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
    STDMETHOD_(ULONG, Release)(THIS) PURE;

    /* IDispatch methods */
    STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE;

    STDMETHOD(GetTypeInfo)(
      THIS_
      UINT itinfo,
      LCID lcid,
      ITypeInfo FAR* FAR* pptinfo) PURE;

    STDMETHOD(GetIDsOfNames)(
      THIS_
      REFIID riid,
      OLECHAR FAR* FAR* rgszNames,
      UINT cNames,
      LCID lcid,
      DISPID FAR* rgdispid) PURE;

    STDMETHOD(Invoke)(
      THIS_
      DISPID dispidMember,
      REFIID riid,
      LCID lcid,
      WORD wFlags,
      DISPPARAMS FAR* pdispparams,
      VARIANT FAR* pvarResult,
      EXCEPINFO FAR* pexcepinfo,
      UINT FAR* puArgErr) PURE;
#endif

    /* IMTEvents methods */
    STDMETHOD(OnConnection)(THIS_ IDispatch * Application, IDispatch * MTDllInst, SAFEARRAY FAR* FAR* Custom) PURE;
    STDMETHOD(OnDisconnection)(THIS_ SAFEARRAY FAR* FAR* Custom) PURE;
};

DEFINE_GUID(CLSID_MTInstance,0x5A224999L,0x0D3B,0x11D2,0xA1,0x8B,0x00,0xC0,0x4F,0x8E,0xC1,0xB3);

#ifdef __cplusplus
class MTInstance;
#endif

DEFINE_GUID(IID_IVbaMT,0x46847E52L,0x1846,0x11D2,0xA1,0x8D,0x00,0xC0,0x4F,0x8E,0xC1,0xB3);

/* Definition of interface: IVbaMT */
#undef INTERFACE
#define INTERFACE IVbaMT

DECLARE_INTERFACE_(IVbaMT, IDispatch)
{
BEGIN_INTERFACE
#ifndef NO_BASEINTERFACE_FUNCS

    /* IUnknown methods */
    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
    STDMETHOD_(ULONG, Release)(THIS) PURE;

    /* IDispatch methods */
    STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE;

    STDMETHOD(GetTypeInfo)(
      THIS_
      UINT itinfo,
      LCID lcid,
      ITypeInfo FAR* FAR* pptinfo) PURE;

    STDMETHOD(GetIDsOfNames)(
      THIS_
      REFIID riid,
      OLECHAR FAR* FAR* rgszNames,
      UINT cNames,
      LCID lcid,
      DISPID FAR* rgdispid) PURE;

    STDMETHOD(Invoke)(
      THIS_
      DISPID dispidMember,
      REFIID riid,
      LCID lcid,
      WORD wFlags,
      DISPPARAMS FAR* pdispparams,
      VARIANT FAR* pvarResult,
      EXCEPINFO FAR* pexcepinfo,
      UINT FAR* puArgErr) PURE;
#endif

    /* IVbaMT methods */
    STDMETHOD(Init)(THIS_ long Cookie, BSTR RegPath, IDispatch * AppObjInst) PURE;
    STDMETHOD(LoadAllRegMTDlls)(THIS_ VbaMTDlls FAR* FAR* Dlls) PURE;
    STDMETHOD(LoadMTDll)(THIS_ BSTR ProgID, VbaMTDll FAR* FAR* Dll) PURE;
    STDMETHOD(get_MTDlls)(THIS_ VbaMTDlls FAR* FAR* Dlls) PURE;
};

DEFINE_GUID(IID_IVbaMTDlls,0x46847E53L,0x1846,0x11D2,0xA1,0x8D,0x00,0xC0,0x4F,0x8E,0xC1,0xB3);

/* Definition of interface: IVbaMTDlls */
#undef INTERFACE
#define INTERFACE IVbaMTDlls

DECLARE_INTERFACE_(IVbaMTDlls, IDispatch)
{
BEGIN_INTERFACE
#ifndef NO_BASEINTERFACE_FUNCS

    /* IUnknown methods */
    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
    STDMETHOD_(ULONG, Release)(THIS) PURE;

    /* IDispatch methods */
    STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE;

    STDMETHOD(GetTypeInfo)(
      THIS_
      UINT itinfo,
      LCID lcid,
      ITypeInfo FAR* FAR* pptinfo) PURE;

    STDMETHOD(GetIDsOfNames)(
      THIS_
      REFIID riid,
      OLECHAR FAR* FAR* rgszNames,
      UINT cNames,
      LCID lcid,
      DISPID FAR* rgdispid) PURE;

    STDMETHOD(Invoke)(
      THIS_
      DISPID dispidMember,
      REFIID riid,
      LCID lcid,
      WORD wFlags,
      DISPPARAMS FAR* pdispparams,
      VARIANT FAR* pvarResult,
      EXCEPINFO FAR* pexcepinfo,
      UINT FAR* puArgErr) PURE;
#endif

    /* IVbaMTDlls methods */
    STDMETHOD(Item)(THIS_ VARIANT itemId, VbaMTDll FAR* FAR* MTDll) PURE;
    STDMETHOD(get_Count)(THIS_ long FAR* Count) PURE;
    STDMETHOD(get__NewEnum)(THIS_ IUnknown * FAR* Enum) PURE;
    STDMETHOD(Remove)(THIS_ VARIANT itemId) PURE;
    STDMETHOD(Add)(THIS_ VARIANT progId, VbaMTDll FAR* FAR* MTDll) PURE;
    STDMETHOD(get_Parent)(THIS_ VbaMT FAR* FAR* MT) PURE;
};

DEFINE_GUID(IID_IVbaMTDll,0x46847E54L,0x1846,0x11D2,0xA1,0x8D,0x00,0xC0,0x4F,0x8E,0xC1,0xB3);

/* Definition of interface: IVbaMTDll */
#undef INTERFACE
#define INTERFACE IVbaMTDll

DECLARE_INTERFACE_(IVbaMTDll, IDispatch)
{
BEGIN_INTERFACE
#ifndef NO_BASEINTERFACE_FUNCS

    /* IUnknown methods */
    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
    STDMETHOD_(ULONG, Release)(THIS) PURE;

    /* IDispatch methods */
    STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo) PURE;

    STDMETHOD(GetTypeInfo)(
      THIS_
      UINT itinfo,
      LCID lcid,
      ITypeInfo FAR* FAR* pptinfo) PURE;

    STDMETHOD(GetIDsOfNames)(
      THIS_
      REFIID riid,
      OLECHAR FAR* FAR* rgszNames,
      UINT cNames,
      LCID lcid,
      DISPID FAR* rgdispid) PURE;

    STDMETHOD(Invoke)(
      THIS_
      DISPID dispidMember,
      REFIID riid,
      LCID lcid,
      WORD wFlags,
      DISPPARAMS FAR* pdispparams,
      VARIANT FAR* pvarResult,
      EXCEPINFO FAR* pexcepinfo,
      UINT FAR* puArgErr) PURE;
#endif

    /* IVbaMTDll methods */
    STDMETHOD(get_Name)(THIS_ BSTR FAR* Name) PURE;
    STDMETHOD(get_ProgID)(THIS_ BSTR FAR* ProgID) PURE;
    STDMETHOD(Unload)(THIS) PURE;
    STDMETHOD(CallMacro)(THIS_ BSTR MacroName) PURE;
    STDMETHOD(GetMTProcList)(THIS_ long FAR* Count, MTPROC FAR* FAR* MTProcList) PURE;
    STDMETHOD(FreeMTProcs)(THIS_ long Count, MTPROC FAR* FAR* MTProcList) PURE;
    STDMETHOD(DoesProcExist)(THIS_ BSTR ProcName, VARIANT_BOOL FAR* Exists) PURE;
    STDMETHOD(get_DllObject)(THIS_ IDispatch * FAR* Disp) PURE;
    STDMETHOD(get_Collection)(THIS_ VbaMTDlls FAR* FAR* MTDlls) PURE;
};

DEFINE_GUID(CLSID_VbaMT,0xFF6A580AL,0x184C,0x11D2,0xA1,0x8E,0x00,0xC0,0x4F,0x8E,0xC1,0xB3);

#ifdef __cplusplus
class VbaMT;
#endif

DEFINE_GUID(CLSID_VbaMTDlls,0xFF6A580BL,0x184C,0x11D2,0xA1,0x8E,0x00,0xC0,0x4F,0x8E,0xC1,0xB3);

#ifdef __cplusplus
class VbaMTDlls;
#endif

DEFINE_GUID(CLSID_VbaMTDll,0xFF6A580CL,0x184C,0x11D2,0xA1,0x8E,0x00,0xC0,0x4F,0x8E,0xC1,0xB3);

#ifdef __cplusplus
class VbaMTDll;
#endif

#endif
